package com.eightbears.beboy.ui.user.activity;

import android.os.Bundle;
import android.webkit.WebView;
import android.widget.TextView;

import com.eightbears.beboy.R;
import com.eightbears.beboy.base.BaseActivity;
import com.eightbears.beboy.base.util.SPUtil;
import com.eightbears.beboy.base.view.SwipeBackLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 用户服务协议页面
 */
public class HelpActivity extends BaseActivity {

    @BindView(R.id.tv_title)
    TextView tv_title;
    @BindView(R.id.webView)
    WebView mWebView;
    private SwipeBackLayout swipeBackLayoutTwo;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_agreement);
        ButterKnife.bind(this);
        initView();
        initData();
        initEvent();
    }

    @Override
    protected void initView() {
        //侧滑删除实力化
        swipeBackLayoutTwo = (SwipeBackLayout) findViewById(R.id.sw_shopdetail);
        tv_title.setText("用户服务协议");
    }

    @Override
    protected void initData() {
        mWebView.loadUrl(SPUtil.getStaticData().getData().getAgreement_url());
    }

    @Override
    protected void initEvent() {
        swipeBackLayoutTwo.setCallBack(new SwipeBackLayout.CallBack() {
            @Override
            public void onFinish() {
                finish();
            }
        });
    }


    @OnClick(R.id.ll_back)
    void back() {
        finish();
    }

}
